#include<bits/stdc++.h>
using namespace std;
int n,a[500010],f[500010],sss,ss,s;
int main()
{
	freopen("fruit.in","r",stdin);
	freopen("fruit.out","w",stdout);
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		scanf("%lld",&a[i]);
	}
	a[0]=a[1];
	while(ss<n)
	{
		sss=-10;
		for(int i=1;i<=n;i++)
	{
		if(sss!=a[i]&&f[i]==0)
		{
			f[i]=1;
			sss=a[i];
			ss++;
			a[i]=a[i-1];
			cout<<i<<" ";
		}
	}
	cout<<endl;
	}
	return 0;
}
